package com.xiaozhen.common.core.domain.driver;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaozhen.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * @Author: zhenweisheng
 * @Date: 2020/8/6 11:00
 * @Description: 设备模型属性
 */
@Data
@TableName("parse_tcp_attribute")
@ApiModel(description = "属性解析")
public class ParseTcpAttribute extends BaseEntity {

    @TableId
    @ApiModelProperty(value = "设备模型属性ID")
    private Long attributeId;

    @ApiModelProperty(value = "父属性的id")
    private Long parentId;

    @ApiModelProperty(value = "驱动ID")
    private Long driverId;

    @ApiModelProperty(value = "分组字段名")
    private String groupField;

    @ApiModelProperty(value = "属性名称")
    private String attributeName;

    @ApiModelProperty(value = "属性类型")
    private String attributeType;

    @ApiModelProperty(value = "属性能力（读写，只读，只写）")
    private String attributeFunction;

    /**
     * 属性类型  byte/short/int/long/float/double/boolean/string
     */
    @ApiModelProperty(value = "属性结果类型")
    private String attributeResultType;

    @ApiModelProperty(value = "属性的开始点位")
    private Integer startPoint;

    @ApiModelProperty(value = "属性的结束点位")
    private Integer endPoint;

    @ApiModelProperty(value = "描述")
    private String description;

    @ApiModelProperty(value = "是否是索引字段")
    private String isTagField;

    @ApiModelProperty(value = "是否存入数据库,默认true")
    private String isSave;

    @ApiModelProperty(value = "该属性的计算步骤")
    @TableField(exist = false)
    private List<ParseTcpAttributeFormula> formulaStepList;

    @ApiModelProperty(value = "该属性的子属性")
    @TableField(exist = false)
    private List<ParseTcpAttribute> children;
}
